<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/21 0021
 * Time: 上午 10:51
 */
namespace app\message\controller;
use app\common\api\AApi;

class Api extends AApi{
    /**
     * 初始化配置
     * @param array $config
     */
    public function __construct(array $config = []){
        parent::__construct();
    }

    /**
     * 用户对象
     */
    static public $obj;

    /**
     * 单列模式实例化对象
     */
    static function getInstance(){
        $data = self::$post_data;
        self::$obj = new Message($data);
        return self::$obj;
    }

    /**
     * 添加
     * @return array|string
     */
    public function mes_add(){
        $obj = self::getInstance();
        $res = $obj->mes_add();
        return create_callback($res);
    }

    /**
     * 修改
     * @return array|string
     */
    public function mes_update(){
        $obj = self::getInstance();
        $res = $obj->mes_update();
        return create_callback($res);
    }


    public function mes_list(){
        $obj = self::getInstance();
        $res = $obj->mes_list();
        return create_callback($res);
    }
    public function mes_list_info(){
        $obj = self::getInstance();
        $res = $obj->mes_list_info();
        return create_callback($res);
    }
}